﻿#region

using System;

#endregion

namespace MediaSage.Lib.Plugin
{
    /// <summary>
    ///     Class to encapsulate return values from metadata returns
    /// </summary>
    public class MediaSearchReturn : IComparable<MediaSearchReturn>
    {
        #region Fields

        /// <summary>
        ///     This is the IMDB ID
        /// </summary>
        public string IMDBID;

        /// <summary>
        ///     This is the TMDB ID
        /// </summary>
        public int TMDBID;

        /// <summary>
        ///     This is the TVDB ID
        /// </summary>
        public int TVDBID;

        /// <summary>
        ///     Episode - This is used for TV programs, set to 0 by default
        /// </summary>
        public int episode = 0;

        /// <summary>
        ///     Name of the media (Title for movie or TV show for example)
        /// </summary>
        public string name;

        /// <summary>
        ///     Each metadata plugin will define a stategy for the likelyhood of a match, this will contain it
        ///     This number is 0<x<100
        /// </summary>
        public float pctLikelyMatch;

        /// <summary>
        ///     Season - This is used for tv programs, set to 0 by default
        /// </summary>
        public int season = 0;

        /// <summary>
        ///     The Year the media was created
        /// </summary>
        public int year;

        #endregion Fields

        #region Methods

        public int CompareTo(MediaSearchReturn Media)
        {
            if (Media == null)
            {
                return 1;
            }

            return pctLikelyMatch.CompareTo(Media.pctLikelyMatch);
        }

        #endregion Methods
    }
}